{% extends "base.html" %}
{% block title %}View Data{% endblock%}
{% block content %}
<script>
  function show(divname){
    document.getElementById(divname).style.display = ''
  }
</script>
  <form action="importfile" method="post" enctype="multipart/form-data">
      <div><input type="file" name="upload"><input type="submit" value="Import file"></div>
  </form>
  <form action="exportfile" method="get">
       <!--<input type="submit" value="export">-->
  </form>
  <hr>
  文件导入格式参照:
  <pre>
  Opensocial:
 ? |
    下面那个不是Opensocial API 支持的接口?
 :
   - Person
   - Activity
   - Appdata
   - Container|right
 ? |
   下面那家网站尚不支持Opensocial标准?
 :
   - 校内网
   - 天涯
   - 51.com
   - 开心网|right
   - MySpace
   - Orkut
   - 一起网
 ? |
   Opensocial 在哪个版本引入对RESTful API的支持?
 :
   - v0.6
   - v0.7
   - v0.8|right
   - v0.9
 ? |
   Opensocial API 最新的版本是:
 :
   - v0.7
   - v0.8
   - v0.8.1|right
   - v0.9
 ? |
   在Opensocial API中我们可以用gadgets.io.makeRequest来向自己的服务器发送请求,
   makeRequest有三种方式,下面哪种不是?
 :
   - NONE
   - OAUTH
   - SIGNED
   - SECURE|right
 ? |
    opensocial.IdSpec 是在Opensocial哪个版本加入的?
 :
   - v0.7
   - v0.8
   - v0.8.1|right
   - v0.9

类别2:
 ? 类别2第一题
 :
   - 答案1|right
   - 答案2
 ? |
   多行问题多行问题
   多行问题多行问题
 :
   - 答案1|right
   - 答案2
   </pre>
  <div><h2>
    {% if not tags%}
        no record
    {% endif%}
    {% for t in tags %}
      {% ifequal selecttag.key.id t.key.id %}
        {{ t.name }}
      {% else %}
        <a href="index?tagid={{ t.key.id }}">{{ t.name }}</a>
      {% endifequal %}
    {% endfor %}
    </h2>
    
    {% if selecttag %}
    <div id="tagaction" style="margin-left:20px;margin-top:10px;">
    <a href="javascript:show('addtagform')">Add Tag</a>&nbsp;|&nbsp;
    <a href="javascript:show('edittagform')">Edit this tag</a>&nbsp;|&nbsp;
    <a href="javascript:show('deltagform')">Delete this tag</a>
    </div>
    
    <div id="addtagform" style="display:none">
    <form action="addtag" method="post">
    <input type="text" name="tagname">
    <input type="submit" value="Add Tag">
    </form>
    </div>
    <div id="edittagform" style="display:none">
    <form action="edittag" method="post">
    <input type="hidden" value="{{ selecttag.key.id }}" name="tagid">
    <input type="text" name="tagname" value="{{ selecttag.name}}">
    <input type="submit" value="Edit Tag">
    </form>
    </div>
    <div id="deltagform" style="display:none">
    
    <form action="deltag" method="post">
    <input type="hidden" name="tagid" value="{{ selecttag.key.id }}">
    Are you sure to delete this tag:{{selecttag.name}}?&nbsp;<input type="submit" value="Yes">
    </form>
    </div>
    </div>
    
    {% endif%}
  <div>
    <br>
    <table border="1" width="80%">
    {% for q in selecttag.questions %}
    <tr><td>{{q.seq}}</td>
      <td>{{ q.title|linebreaks }}</a></td>
      <td><!--<a href="editq?id={{ q.key.id }}">edit</a>&nbsp;|<a href="delq?id={{ q.key.id }}">delete</a>|<a href="depre?id={{q.key.id}}">hide</a>-->
      </td>
    </tr>
    <tr><td></td>
    <td>
    <ul>
       {% for a in q.answers%}
         <li>{{ a.text }}</li>
       {% endfor %}
    <ul>
    </td>
    <td>
    <ul>
       {% for a in q.answers%}
         <li><!--<a href="edita?id={{ a.key.id }}">edit</a>|<a href="#">delete</a>|<input type="checkbox" {% if a.isRight%}checked{% endif%}>right?-->{% if a.isRight%}right{% endif%}</li>
       {% endfor %}
    <ul>
    </td>
    </tr>
    {% endfor %}
    </table>
    
    
{% endblock %}
